package com.example.demo.dao.zl;


import com.example.demo.entity.Permission;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.*;

//import java.util.Date;
import java.util.List;
@Mapper
public interface PermissionDao1 {
    @Select("select * from system_permission")
    //查询
    public  List<Permission> FINDALL();
    @Select("select * from system_permission where name=#{name} ")
    public List<Permission> findByName(String name);
    //添加
    @Insert("insert into system_permission(name,descripion,url,pid,perms,type,icon,order_num)values (#{name,jdbcType=VARCHAR},#{descripion,jdbcType=VARCHAR},#{url,jdbcType=VARCHAR},#{pid,jdbcType=VARCHAR},#{perms,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{order_num,jdbcType=VARCHAR})")
    public int insert(@Param("name") String name,@Param("descripion") String descripion,@Param("url") String url,@Param("pid") String  pid,@Param("perms") String perms,@Param("type") int type,@Param("icon") String icon,@Param("order_num") int order_num);
    @Delete("delete from system_permission where id=#{id}")
    public int delete(int id);
    @Update("update system_permission set name=#{name,jdbcType=VARCHAR},descripion=#{descripion,jdbcType=VARCHAR},url=#{url,jdbcType=VARCHAR},pid=#{pid,jdbcType=VARCHAR},perms=#{perms,jdbcType=VARCHAR},type=#{type,jdbcType=VARCHAR},icon=#{icon,jdbcType=VARCHAR},order_num=#{order_num,jdbcType=VARCHAR} WHERE id=#{id}")
    public int update(@Param("id") int id,@Param("name") String name,@Param("descripion") String descripion,@Param("url") String url,@Param("pid") String  pid,@Param("perms") String perms,@Param("type") int type,@Param("icon") String icon,@Param("order_num") int order_num);
}


